package com.tj.collection.enums;

/**
 * Author: Karl
 * Date: 2020/12/21 11:41 上午
 */
public enum ClUserContactTypeEnum {
    Parent(1, "Parent"),
    Brother(2, "Brother"),
    Sister(3, "Sister"),
    Child(4, "Child"),
    Spouse(5, "Spouse"),
    Other(6, "Other"),
    ;

    private Integer type;

    private String desc;

    ClUserContactTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public  ClUserContactTypeEnum setType(Integer type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public  ClUserContactTypeEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static  ClUserContactTypeEnum getEnum(Integer type) {
        for ( ClUserContactTypeEnum enumObj :  ClUserContactTypeEnum.values()) {
            if (enumObj.getType().equals(type)) {
                return enumObj;
            }
        }
        return null;
    }
}
